﻿Public Class DataProvider
    'Public Shared _strConnectionString As String = "Data Source=.\SQLExpress;AttachDbFilename=|DataDirectory|\QL_GioiThieuNhaThue.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
    Public Shared _strConnectionString As String = "Data Source=.\SQLEXPRESS;Initial Catalog=QUANLYTHUENHA;Integrated Security=True"

    'Public Function OpenConnection() As Boolean
    '    Try
    '        _Connection = New SqlConnection(_strConnectionString)
    '        If _Connection.State = ConnectionState.Open Then
    '            _Connection.Close()
    '        End If
    '        _Connection.Open()
    '        Return True
    '    Catch
    '        MessageBox.Show("Không thể Mở kết nối cơ sở dữ liệu! \n Lỗi: kết nối", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error)
    '        Return False
    '    End Try

    'End Function

    'Public Function CloseConnection() As Boolean
    '    Try
    '        _Connection = New SqlConnection(_strConnectionString)
    '        If _Connection.State = ConnectionState.Open Then
    '            _Connection.Close()
    '        End If
    '        Return True
    '    Catch
    '        MessageBox.Show("Không thể đóng kết nối cơ sở dữ liệu! ", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error)
    '        Return False
    '    End Try

    'End Function
End Class
